package com.rongc.client.freight.base.view.adapter;

import android.content.Context;

import com.rongc.client.freight.R;
import com.rongc.client.freight.base.model.BaseDic;

import java.util.HashMap;
import java.util.List;

/**
 * Created by ccqx on 2017/6/28.
 */

public class RecyclerMainAdapter extends RecyclerBaseAdapter<HashMap<String,String>>{


    public RecyclerMainAdapter(Context mContext, List<HashMap<String, String>> mDatas) {
        super(mContext, mDatas);
    }

    @Override
    protected void onBind(final BaseRecyclerViewHolder holder, int position, HashMap<String, String> data) {

        switch (data.get("type")){
            case BaseDic.OperateType.SHIPPER_CREATE_TYPE:
                holder.setText(R.id.tv_content,R.string.main_create_supply);
                holder.setImageResource(R.id.iv_icon, R.mipmap.home_icon_h_fbhy);
                break;

            case BaseDic.OperateType.SHIPPER_FIND_TYPE:
                holder.setText(R.id.tv_content,R.string.main_find_conveyance);
                holder.setImageResource(R.id.iv_icon, R.mipmap.home_icon_h_zc);
                break;

            case BaseDic.OperateType.CARRIER_CREATE_TYPE:
                holder.setText(R.id.tv_content,R.string.main_create_conveyance);
                holder.setImageResource(R.id.iv_icon, R.mipmap.home_icon_s_fbcy);
                break;

            case BaseDic.OperateType.CARRIER_FIND_TYPE:
                holder.setText(R.id.tv_content,R.string.main_find_supply);
                holder.setImageResource(R.id.iv_icon, R.mipmap.home_icon_s_zh);
                break;
        }



    }

    @Override
    protected int getLayoutId() {
        return R.layout.recycler_main_item;
    }
}
